<template>
  <u-toast ref="uToast"></u-toast>
  <view class="Setting">
    <view class="Title">我的账户</view>
    <view class="Settinglist">
      <view
        class="flex_al_cen_ju_bet"
        @click="NavTo('/pages/Login/ChangePassword?&Type=0')"
      >
        <view>修改密码</view>
        <u-icon name="arrow-right" color="#000" size="16"></u-icon>
      </view>
      <!-- <view class="flex_al_cen_ju_bet" @click="NavTo('/pages/Wode/modifyPhone')">
        <view>修改手机号</view>
        <view class="flex">
          <view style="margin-right: 20rpx">{{ oldMoblied.substring(0, 3) + '****' +
            oldMoblied.substring(oldMoblied.length - 4) }}</view>
          <u-icon name="arrow-right" color="#000" size="16"></u-icon>
        </view>
      </view> -->
      <view class="xian"></view>
      <view
        class="flex_al_cen_ju_bet"
        @click="NavTo('/pages/UserAgreement/userGetPrivacyPolicy')"
      >
        <view>隐私政策</view>
        <u-icon name="arrow-right" color="#000" size="16"></u-icon>
      </view>
      <view class="flex_al_cen_ju_bet" @click.stop="remove">
        <view>清除缓存</view>
        <u-icon name="arrow-right" color="#000" size="16"></u-icon>
      </view>
      <view class="flex_al_cen_ju_bet" @click.stop="logOff">
        <view>注销账号</view>
        <view class="flex">
          <text style="font-size: 20rpx; color: #777777">
            注销后无法恢复，请谨慎操作</text
          >
          <u-icon
            name="arrow-right"
            style="margin-left: 20rpx"
            color="#000"
            size="16"
          ></u-icon>
        </view>
      </view>
      <view class="flex_al_cen_ju_bet">
        <view>版本号</view>
        <view class="flex">
          {{ Appversion.version }}
          <u-icon
            name="arrow-right"
            style="margin-left: 20rpx"
            color="#000"
            size="16"
          ></u-icon>
        </view>
      </view>
    </view>
    <u-toast ref="uToast"></u-toast>
  </view>
  <u-modal
    :show="modelShow"
    title=""
    confirmText="确认"
    :showCancelButton="true"
    cancelColor="#000"
    confirmColor="#AAAAAA"
    @cancel="modelShow = false"
    @confirm="confirmSkipModel"
  >
    <view class="model_box">
      <text style="color: #000; margin-bottom: 20rpx">注销账号</text>
      <image
        class="icon_image"
        src="@/static/images/pulice/waring.png"
        mode="scaleToFill"
      />
      <view style="font-size: 20rpx; color: #777777"
        >身份信息,账号资产及权益将被清空且无法找回</view
      >
    </view>
  </u-modal>
</template>
<script setup lang="ts">
import { NavTo } from "@/utlis/uni_api";
import { reactive, getCurrentInstance } from "vue";
import settingPhone from "@/Hooks/Wode/settingPhone";
// import { removeStor } from "@/Pinia/index";
import { onShow } from "@dcloudio/uni-app";
const { proxy } = getCurrentInstance() as any;
const { oldMoblied, logOff, modelShow, confirmSkipModel } = settingPhone(proxy);
// 清楚缓存
const remove = () => {
  proxy.$API(proxy).Toast("清除成功", "success");
};
// App版本信息
const Appversion = reactive<{ version: string }>({
  version: "",
});
onShow(() => {
  // #ifdef APP-PLUS
  const Appid = plus.runtime.appid;
  plus.runtime.getProperty(<string>Appid, (wgtInfo) => {
    console.log(wgtInfo);
    Appversion.version = <string>wgtInfo.version; // appVersion就是版本号
  });
  // #endif
});
</script>
<style lang="scss" scoped>
@import "../../static/css/Wode/setting.scss";
</style>
